import React, { Component } from 'react'
import axios from 'axios';
export default class Student extends Component {
    render() {
        return (
            <div>
                <button onClick={this.student}>获取学生信息</button>
                <button onClick={this.car}>获取汽车信息</button>
                <button onClick={this.zhihu}>获取知乎热榜</button>
                <button onClick={this.zhihuKexue}>获取科学热榜</button>
            </div>
        )
    }

    student = async () => {
        let response = await axios.get('/api1/students');
        console.log(response);

        let news = await axios.get('/api1/news');
        console.log(news);
    }

    car = async () => {
        let response = await axios.get('/cars');
        console.log(response);
    }

    zhihu = async () => {
        let result = await axios.get('/zhihu/api/v3/feed/topstory/hot-lists/total?limit=50&desktop=true');
        console.log(result);
    }

    zhihuKexue = async () => {
        let result = await axios.get('/zhihu/api/v3/feed/topstory/hot-lists/science?limit=50&desktop=true')
        console.log(result);
    }
    
}
